package com.czhlearn.anno;

import com.czhlearn.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

/**
 * @program: big-event
 * @description:
 * @author: czh
 * @create: 2023-12-19 14:59
 **/

@Documented  //元注解
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(
        validatedBy = { StateValidation.class} //指定提供校验的类
)
public @interface State {
    // 提供校验失败后的提示信息
    String message() default "start参数的值只能是 已发布或者草稿";

    //指定分组
    Class<?>[] groups() default {};

    //负载  获取start注解的附加信息
    Class<? extends Payload>[] payload() default {};
}
